﻿Imports ORTCLib

Public Class VORT
    Dim stcc As New STCCOrders()
    Dim WithEvents fos As FilledOrders = stcc.FilledOrders
    Dim WithEvents aos As ActiveOrders = stcc.ActiveOrders

    Public Event Add(ByVal info As List(Of String))
    Public Event Insert(ByVal aInfo As List(Of String))

    Private Sub fos_Add(ByVal pDisp As Object) Handles fos.Add
        Dim fo As FilledOrder
        Dim lstSignal As New List(Of String)
        fo = pDisp
        lstSignal.Add(fo.Symbol)
        lstSignal.Add(fo.OrderType)
        lstSignal.Add(fo.Order)
        lstSignal.Add(fo.FillPrice.ToString())
        lstSignal.Add(fo.SlippageBaseCode.ToString())
        lstSignal.Add(fo.TimePlaced.ToString())
        lstSignal.Add(fo.TimeFilled.ToString())
        lstSignal.Add(fo.System)
        lstSignal.Add(fo.Signal)
        lstSignal.Add(fo.WorkSpace)
        lstSignal.Add(fo.Interval)
        lstSignal.Add(fo.PositionNumber)
        RaiseEvent Add(lstSignal)
    End Sub

    Private Sub aos_Insert(ByVal aDisp As Object) Handles aos.Add
        Dim ao As ActiveOrder
        Dim aSignal As New List(Of String)
        ao = aDisp
        aSignal.Add(ao.Symbol)
        aSignal.Add(ao.OrderType)
        aSignal.Add(ao.Order)
        aSignal.Add(ao.System)
        aSignal.Add(ao.Signal)
        RaiseEvent Add(aSignal)
    End Sub


End Class
